import { createAction } from 'redux-actions';
import * as types from '../constants/ActionTypes';
import * as Api from '../utils/WebAPIUtils.js';
import Tool from '../utils/ToolUtils.js';

const savePasswd = createAction(types.SAVE_PASSWD, data => data);
exports.restoreTestPackage = createAction(types.RESTORE_TEST_PACKAGE, data => data);

exports.editPasswd = (data) => (dispath) =>
  Tool.post(Api.userManage.editPasswd, data, (res) => {
    dispath(savePasswd(res));
  });
